<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
		<meta http-equiv="description" content="This is my page" />

		<link rel="stylesheet" type="text/css" href="<%=path%>/css/base.css" />
		<script type="text/javascript" src="<%=path%>/js/popup.js"></script>
		<script language="javascript">

	    function studentDel(id)
           {
               if(confirm('您确定删除吗？'))
               {
                   window.location.href="<%=path%>/studentDel.action?id="+id;
               }
           }
           
              function updateStuPwd(id)
           {
               if(confirm('您确定要重置密码为123456吗？'))
               {
                   window.location.href="<%=path %>/updateStuPwd.action?id="+id;
               }
           }
           
           
           function studentEditPre(id)
           {
                   window.location.href="<%=path%>/studentEditPre.action?id="+id;
           }
           
           function studentAdd()
           {
                 var url="<%=path%>/tostudentAdd.action";
                
		        window.location.href=url;
           }


 

       </script>
	</head>

	<body leftmargin="2" topmargin="2"
		background='<%=path%>/images/allbg.gif'>
		
		<br/>
	<form action="<%=path%>/studentList.action" method="post">
	   &nbsp; 姓名：  <input type="text" name="name" value="${name}"/>
					   
					   <input type="submit" value="查询"/>
	
	</form>
	
		<table width="98%" border="0" cellpadding="2" cellspacing="1"
			bgcolor="#D1DDAA" align="center" style="margin-top: 8px">
			<tr bgcolor="#E7E7E7">
				<td height="14" colspan="15" background="<%=path%>/images/tbg.gif">
					&nbsp;学生信息管理&nbsp;
				</td>
			</tr>
			<tr align="center" bgcolor="#FAFAF1" height="22">
			 <td>
					学号
				</td>
				<td>
					姓名
				</td>
				<td>
					性别
				</td>
				<td>
					出生日期
				</td>
				 
				<td>
					联系方式
				</td>
				
					
				 	<td>
					班级
				</td>
				<td>
					年级
				</td>
				<td>
					政治面貌
				</td>
				<td>
					民族
				</td>
				<td>
					身份证号
				</td>
				<td>
					籍贯
				</td>
				<td>
					家庭地址
				</td>
				<td>
					院系专业
				</td>
				<td>
					学制
				</td>
				
				<td>
					用户名
				</td>
				
				<td width="15%">
					操作
				</td>
			</tr>

			<c:forEach items="${studentList}" var="student" varStatus="sta">
				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">


				 <td bgcolor="#FFFFFF" align="center">
						${student.sno}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${student.name}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${student.sex}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${student.birthday}
					</td>
					 
                    <td bgcolor="#FFFFFF" align="center">
						${student.ftel}
					</td>
					  
					   <td bgcolor="#FFFFFF" align="center">
						${student.bname}
					</td>
					
					   <td bgcolor="#FFFFFF" align="center">
						${student.nj}
					</td>
					
					   <td bgcolor="#FFFFFF" align="center">
						${student.face}
					</td>
					
					   <td bgcolor="#FFFFFF" align="center">
						${student.nation}
					</td>
					
					   <td bgcolor="#FFFFFF" align="center">
						${student.idnumber}
					</td>
					
					   <td bgcolor="#FFFFFF" align="center">
						${student.provice}
					</td>
					
					   <td bgcolor="#FFFFFF" align="center">
						${student.address}
					</td>
					
					   <td bgcolor="#FFFFFF" align="center">
						${student.orginazation}
					</td>
					   <td bgcolor="#FFFFFF" align="center">
						${student.level}
					</td>
					
					<td bgcolor="#FFFFFF" align="center">
						${student.uname}
					</td>
					
					<td bgcolor="#FFFFFF" align="center">

                      
						<input type="button" value="修改"
							onclick="studentEditPre('${student.id}')" />
						<input type="button" value="删除"
							onclick="studentDel('${student.id}')" />

  <input type="button" value="重置密码" onclick="updateStuPwd('${student.id}')"/>

					</td>
				</tr>
			</c:forEach>
		</table>

		<table width='98%' border='0'
			style="margin-top: 8px; margin-left: 5px;">
			<tr>
				<td>
					<input type="button" value="添加" style="width: 80px;"
						onclick="studentAdd()" />
				</td>
			</tr>
		</table>

	</body>
</html>